﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using System;

public class UserData : Singleton<UserData>
{

    public List<SelectRoleInfo> AllRole = new List<SelectRoleInfo>();

    internal static void OnRoleList(Cmd cmd)
    {
        if (!Nets.CheckCmd(cmd, typeof(RoleListCmd)))
        {
            return;
        }
        RoleListCmd roleListCmd = cmd as RoleListCmd;

        UserData.instance.AllRole = roleListCmd.AllRole;
        if (roleListCmd.AllRole.Count > 0)
        {
            SceneManager.LoadScene("SelectRole");
            UIManager.instance.Replace("UI/SelectRole/SelectRole");
        }
        else
        {
            SceneManager.LoadScene("CreateRole");
        }

    }

}
